package com.atguigu.java14;

public class InstanceofTest {
    public static void main(String[] args) {
        Object obj = 1;
        if(obj instanceof Integer) {
            Integer i = (Integer) obj;
            System.out.println(i);
        }

        if(obj instanceof Integer i) {
            System.out.println(i);
        }
    }
}
